From 1ced1dc8dd9c3a6dbe75055092691c15745c3402 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Sun, 22 Mar 2015 16:58:11 -0700 Subject: [PATCH] Update to rust 2015-03-22 --- Cargo.lock | 83 ++++++++++++------------ Makefile.in | 2 +- src/bin/cargo.rs | 4 +- src/cargo/util/lev_distance.rs | 4 +- src/rustversion.txt | 2 +- src/snapshots.txt | 8 +++ tests/support/mod.rs | 4 +- tests/test_cargo_bench.rs | 2 +- tests/test_cargo_build_auth.rs | 6 +- tests/test_cargo_compile.rs | 1 + tests/test_cargo_compile_custom_build.rs | 8 ++- tests/test_cargo_compile_git_deps.rs | 1 + tests/test_cargo_compile_plugins.rs | 1 + tests/test_cargo_cross_compile.rs | 1 + tests/test_cargo_publish.rs | 2 +- tests/test_cargo_test.rs | 2 +- tests/tests.rs | 2 +- 17 files changed, 76 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1a92674f0..29c5d503c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,26 +3,26 @@ name = "cargo" version = "0.1.0" dependencies = [ "advapi32-sys 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "curl 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "docopt 0.6.51 (registry+https://github.com/rust-lang/crates.io-index)", - "env_logger 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "curl 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "docopt 0.6.52 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "flate2 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "git2 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "git2-curl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "glob 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "hamcrest 0.1.0 (git+https://github.com/carllerche/hamcrest-rust.git)", "kernel32-sys 0.0.11 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", "registry 0.1.0", - "rustc-serialize 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "semver 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", - "tar 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tempdir 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "term 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tar 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tempdir 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "term 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "threadpool 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", @@ -43,7 +43,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "curl" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "curl-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", @@ -65,20 +65,20 @@ dependencies = [ [[package]] name = "docopt" -version = "0.6.51" +version = "0.6.52" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "env_logger" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "regex 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -93,17 +93,17 @@ dependencies = [ [[package]] name = "gcc" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "git2" -version = "0.2.3" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libgit2-sys 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libgit2-sys 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -112,9 +112,9 @@ name = "git2-curl" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "curl 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "git2 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "curl 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "git2 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "url 0.2.27 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -143,11 +143,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libgit2-sys" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libssh2-sys 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "libssh2-sys 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -163,7 +163,7 @@ dependencies = [ [[package]] name = "libssh2-sys" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -182,8 +182,11 @@ dependencies = [ [[package]] name = "log" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", +] [[package]] name = "matches" @@ -195,7 +198,7 @@ name = "miniz-sys" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -204,7 +207,7 @@ name = "openssl-sys" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "libressl-pnacl-sys 2.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -222,11 +225,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "rand" -version = "0.1.4" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -238,13 +241,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" name = "registry" version = "0.1.0" dependencies = [ - "curl 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "curl 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rustc-serialize" -version = "0.3.4" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -254,20 +257,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "tar" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "tempdir" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "term" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "kernel32-sys 0.0.11 (registry+https://github.com/rust-lang/crates.io-index)", @@ -281,10 +284,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "time" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "gcc 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "gcc 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -293,7 +296,7 @@ name = "toml" version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc-serialize 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -302,7 +305,7 @@ version = "0.2.27" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-serialize 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] diff --git a/Makefile.in b/Makefile.in index 1cc62e48e..caf383c9a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -57,7 +57,7 @@ define DIST_TARGET ifdef CFG_ENABLE_OPTIMIZE TARGET_$(1) = $$(TARGET_ROOT)/$(1)/release else -TARGET_$(1) = $$(TARGET_ROOT)/$(1) +TARGET_$(1) = $$(TARGET_ROOT)/$(1)/debug endif DISTDIR_$(1) = $$(TARGET_$(1))/dist IMGDIR_$(1) = $$(DISTDIR_$(1))/$$(PKG_NAME)-$(1)-image diff --git a/src/bin/cargo.rs b/src/bin/cargo.rs index 0ad3a53c2..f03446362 100644 --- a/src/bin/cargo.rs +++ b/src/bin/cargo.rs @@ -1,4 +1,4 @@ -#![feature(core, io, std_misc, exit_status)] +#![feature(core, exit_status, fs_ext)] extern crate "git2-curl" as git2_curl; extern crate "rustc-serialize" as rustc_serialize; @@ -191,7 +191,7 @@ fn execute_subcommand(cmd: &str, args: &[String], shell: &mut MultiShell) { } } } - Err(ref e) if e.kind() == io::ErrorKind::FileNotFound => { + Err(ref e) if e.kind() == io::ErrorKind::NotFound => { handle_error(CliError::new("No such subcommand", 127), shell) } Err(err) => { diff --git a/src/cargo/util/lev_distance.rs b/src/cargo/util/lev_distance.rs index 1bb7d8e30..4ae55a9eb 100644 --- a/src/cargo/util/lev_distance.rs +++ b/src/cargo/util/lev_distance.rs @@ -14,7 +14,7 @@ pub fn lev_distance(me: &str, t: &str) -> usize { if me.is_empty() { return t.chars().count(); } if t.is_empty() { return me.chars().count(); } - let mut dcol = range(0, t.len() + 1).collect::>(); + let mut dcol = (0..t.len() + 1).collect::>(); let mut t_last = 0; for (i, sc) in me.chars().enumerate() { @@ -45,7 +45,7 @@ pub fn lev_distance(me: &str, t: &str) -> usize { fn test_lev_distance() { use std::char::{ from_u32, MAX }; // Test bytelength agnosticity - for c in range(0u32, MAX as u32) + for c in (0u32..MAX as u32) .filter_map(|i| from_u32(i)) .map(|i| i.to_string()) { assert_eq!(lev_distance(&c, &c), 0); diff --git a/src/rustversion.txt b/src/rustversion.txt index cadd5e2ca..4b542348b 100644 --- a/src/rustversion.txt +++ b/src/rustversion.txt @@ -1 +1 @@ -2015-03-14 +2015-03-22 diff --git a/src/snapshots.txt b/src/snapshots.txt index 5b78f0a8c..ee4469eca 100644 --- a/src/snapshots.txt +++ b/src/snapshots.txt @@ -1,3 +1,11 @@ +2015-03-17 + linux-i386 96a64fa9b4b6cc0cddaa90ecde4e08254c9025d5 + linux-x86_64 354bb5b11b1f19e270ebc0553db1ddc560999bdb + macos-i386 d1b69ef765bc450a3758b8abdb0909df7893058b + macos-x86_64 a2328a82e073c230cd88dcfac96bdc784a999200 + winnt-i386 fb6e346d59bda47ed87e36800e8bfe210cf01297 + winnt-x86_64 4ef3d1ce315df8b27bd842fb66b8e2b03ce99a08 + 2015-02-26 linux-i386 2a28b604d09b4a76a54a05d91f7f158692427b3a linux-x86_64 7367f4aca86d38e209ef7236b00175df036c03e2 diff --git a/tests/support/mod.rs b/tests/support/mod.rs index a225ee68a..5d347c455 100644 --- a/tests/support/mod.rs +++ b/tests/support/mod.rs @@ -251,7 +251,7 @@ pub fn cargo_dir() -> PathBuf { */ #[derive(Clone)] -struct Execs { +pub struct Execs { expect_stdout: Option, expect_stdin: Option, expect_stderr: Option, @@ -436,7 +436,7 @@ pub fn execs() -> Execs { } #[derive(Clone)] -struct ShellWrites { +pub struct ShellWrites { expected: String } diff --git a/tests/test_cargo_bench.rs b/tests/test_cargo_bench.rs index 071d44d8a..02e300f32 100644 --- a/tests/test_cargo_bench.rs +++ b/tests/test_cargo_bench.rs @@ -468,7 +468,7 @@ test!(cargo_bench_twice { p.cargo_process("build"); - for _ in range(0, 2) { + for _ in 0..2 { assert_that(p.cargo("bench"), execs().with_status(0)); } diff --git a/tests/test_cargo_build_auth.rs b/tests/test_cargo_build_auth.rs index da306c1a5..ef3a940ef 100644 --- a/tests/test_cargo_build_auth.rs +++ b/tests/test_cargo_build_auth.rs @@ -15,7 +15,7 @@ fn setup() { // Test that HTTP auth is offered from `credential.helper` test!(http_auth_offered { let a = TcpListener::bind("127.0.0.1:0").unwrap(); - let addr = a.socket_addr().unwrap(); + let addr = a.local_addr().unwrap(); fn headers(rdr: &mut BufRead) -> HashSet { let valid = ["GET", "Authorization", "Accept", "User-Agent"]; @@ -116,7 +116,7 @@ Caused by: // Boy, sure would be nice to have a TLS implementation in rust! test!(https_something_happens { let a = TcpListener::bind("127.0.0.1:0").unwrap(); - let addr = a.socket_addr().unwrap(); + let addr = a.local_addr().unwrap(); let t = thread::spawn(move|| { drop(a.accept().unwrap()); }); @@ -163,7 +163,7 @@ Caused by: // Boy, sure would be nice to have an SSH implementation in rust! test!(ssh_something_happens { let a = TcpListener::bind("127.0.0.1:0").unwrap(); - let addr = a.socket_addr().unwrap(); + let addr = a.local_addr().unwrap(); let t = thread::spawn(move|| { drop(a.accept().unwrap()); }); diff --git a/tests/test_cargo_compile.rs b/tests/test_cargo_compile.rs index b3fc84c1a..8cd2466d9 100644 --- a/tests/test_cargo_compile.rs +++ b/tests/test_cargo_compile.rs @@ -1298,6 +1298,7 @@ test!(rebuild_preserves_out_dir { .file("build.rs", r#" use std::env; use std::old_io::File; + use std::old_path::{Path, GenericPath}; fn main() { let path = Path::new(env::var("OUT_DIR").unwrap()).join("foo"); diff --git a/tests/test_cargo_compile_custom_build.rs b/tests/test_cargo_compile_custom_build.rs index 20b4557ef..6ed0bef4e 100644 --- a/tests/test_cargo_compile_custom_build.rs +++ b/tests/test_cargo_compile_custom_build.rs @@ -783,6 +783,7 @@ test!(out_dir_is_preserved { .file("build.rs", r#" use std::env; use std::old_io::File; + use std::old_path::{Path, GenericPath}; fn main() { let out = env::var("OUT_DIR").unwrap(); File::create(&Path::new(out).join("foo")).unwrap(); @@ -888,7 +889,8 @@ test!(code_generation { "#) .file("build.rs", r#" use std::env; - use std::old_io::File; + use std::old_io::{File, Writer}; + use std::old_path::{Path, GenericPath}; fn main() { let dst = Path::new(env::var("OUT_DIR").unwrap()); @@ -1052,7 +1054,8 @@ test!(test_a_lib_with_a_build_command { "#) .file("build.rs", r#" use std::env; - use std::old_io::File; + use std::old_io::{File, Writer}; + use std::old_path::{Path, GenericPath}; fn main() { let out = Path::new(env::var("OUT_DIR").unwrap()); @@ -1143,6 +1146,7 @@ test!(build_script_with_dynamic_native_dependency { "#) .file("bar/build.rs", r#" use std::env; + use std::old_path::{Path, GenericPath}; fn main() { let src = Path::new(env::var("SRC").unwrap()); diff --git a/tests/test_cargo_compile_git_deps.rs b/tests/test_cargo_compile_git_deps.rs index cae0dcadd..0610f122c 100644 --- a/tests/test_cargo_compile_git_deps.rs +++ b/tests/test_cargo_compile_git_deps.rs @@ -1257,6 +1257,7 @@ test!(git_dep_build_cmd { "#) .file("bar/build.rs", r#" use std::old_io::fs; + use std::old_path::{Path, GenericPath}; fn main() { fs::copy(&Path::new("src/bar.rs.in"), &Path::new("src/bar.rs")).unwrap(); diff --git a/tests/test_cargo_compile_plugins.rs b/tests/test_cargo_compile_plugins.rs index b983e2cfb..97d897f03 100644 --- a/tests/test_cargo_compile_plugins.rs +++ b/tests/test_cargo_compile_plugins.rs @@ -139,6 +139,7 @@ test!(plugin_with_dynamic_native_dependency { "#) .file("bar/build.rs", r#" use std::old_io::fs; + use std::old_path::{Path, GenericPath}; use std::os; fn main() { diff --git a/tests/test_cargo_cross_compile.rs b/tests/test_cargo_cross_compile.rs index 7f75ed34e..81a4e81ed 100644 --- a/tests/test_cargo_cross_compile.rs +++ b/tests/test_cargo_cross_compile.rs @@ -455,6 +455,7 @@ test!(cross_with_a_build_script { "#) .file("build.rs", format!(r#" use std::env; + use std::old_path::{{Path, GenericPath}}; fn main() {{ assert_eq!(env::var("TARGET").unwrap().as_slice(), "{0}"); let mut path = Path::new(env::var("OUT_DIR").unwrap()); diff --git a/tests/test_cargo_publish.rs b/tests/test_cargo_publish.rs index f52b38a3d..55eef734d 100644 --- a/tests/test_cargo_publish.rs +++ b/tests/test_cargo_publish.rs @@ -73,7 +73,7 @@ test!(simple { // Verify the tarball let mut rdr = GzDecoder::new(f).unwrap(); - assert_eq!(rdr.header().filename(), Some(b"foo-0.0.1.crate")); + assert_eq!(rdr.header().filename().unwrap(), "foo-0.0.1.crate".as_bytes()); let mut contents = Vec::new(); rdr.read_to_end(&mut contents).unwrap(); let inner = Cursor::new(contents); diff --git a/tests/test_cargo_test.rs b/tests/test_cargo_test.rs index bde0542dc..88d2a47cb 100644 --- a/tests/test_cargo_test.rs +++ b/tests/test_cargo_test.rs @@ -465,7 +465,7 @@ test!(cargo_test_twice { p.cargo_process("build"); - for _ in range(0, 2) { + for _ in 0..2 { assert_that(p.cargo("test"), execs().with_status(0)); } diff --git a/tests/tests.rs b/tests/tests.rs index f5c790ba4..9d26721f6 100644 --- a/tests/tests.rs +++ b/tests/tests.rs @@ -1,5 +1,5 @@ #![feature(core, io, old_io)] -#![feature(std_misc, io, fs, net, path_ext, fs_time, fs_walk)] +#![feature(std_misc, io, fs, fs_ext, path_ext, fs_time, fs_walk)] extern crate "rustc-serialize" as serialize; extern crate cargo; -- 2.30.2